home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.lang.c
- Subject: Re: malloc question
- Date: Tue, 12 Mar 96 21:45:47 GMT
- Organization: none
- Distribution: world
- Message-ID: <826667147snz@genesis.demon.co.uk>
- References: <4htonk$350@news.hklink.net> <danpop.826488975@rscernix> <4i44vk$g16@rigel.rz.uni-ulm.de>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <4i44vk$g16@rigel.rz.uni-ulm.de>
- peinel@faw.uni-ulm.de "Gertraud Peinel" writes:
-
- >Hmmm, and what should I do with this (especially when I have to use these
- >compilers) ? :
-
- ...
-
- > main()
- > {
- > PITEM head, current;
- > head= malloc(sizeof(ITEM));
- > head->val=1;
- > }
- > sun5:/users/peinel/clang(29)> cc oh.c
- > "oh.c", line 11: warning: illegal pointer combination
-
- Complain to your vendor if they can't supply you with a compiler that conforms
- to a 7 year old standard, or install gcc. There is really no excuse to write
- C code on current or recent production platforms that doesn't use the full
- benefits of the ANSI language.
-
- > sun5:/users/peinel/clang(32)> CC oh.c
- > CC mist.c:
- > "oh.c", line 11: error: no standard conversion of char * to struct item *
- > "oh.c", line 10: warning: current not used
- > 1 error
- > sun5:/users/peinel/clang(33)> which CC
- > /com/owc++/bin/CC
-
- If you're writing in C++ you make use of the facilities provided by *that*
- language i.e. you don't use malloc or void *
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-